//
//  OrgListInformationView.m
//  Weiweiyunshi
//
//  Created by 张旭峰 on 2017/1/24.
//  Copyright © 2017年 王译. All rights reserved.
//

#import "OrgListInformationView.h"
#import "PrefixHeader.pch"
@implementation OrgListInformationView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self createView];
    }
    return self;
}

-(void)createView{
    self.backImageView = [[UIImageView alloc]init];
    //self.backImageView.backgroundColor = RAN_COLOR
    self.backImageView.image = [UIImage imageNamed:@"addbookinfo"];
    self.portraitImageView = [[UIImageView alloc]init];
    //    self.portraitImageView.backgroundColor = RAN_COLOR
    
    self.nameLabel = [[UILabel alloc]init];
   // self.nameLabel.backgroundColor = RAN_COLOR
    self.nameLabel.textColor = [UIColor whiteColor];
    
    self.orgLabel = [[UILabel alloc]init];
   // self.orgLabel.backgroundColor = RAN_COLOR
    self.orgLabel.textColor = [UIColor whiteColor];
    self.enterButton =[[UIButton alloc]init];
    self.enterButton.backgroundColor = [UIColor colorWithRed:83 green:215 blue:105];
    [self.enterButton setTitle:@"进入会议室" forState:UIControlStateNormal];
    [self.enterButton setTitleColor:[UIColor whiteColor]forState:UIControlStateNormal];
    self.callButton = [[UIButton alloc]init];
    self.callButton.backgroundColor = RAN_COLOR
    [self.callButton setTitle:@"呼叫" forState:UIControlStateNormal];
    [self.callButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.informationListView = [[UITableView alloc]init];
    [self addSubview:self.backImageView];
    
    NSArray *arr = @[self.portraitImageView,self.nameLabel,self.orgLabel];
    [self.backImageView sd_addSubviews:arr];
    NSArray *arr1 = @[self.enterButton,self.callButton,self.informationListView];
    [self sd_addSubviews:arr1];
  //  [self addSubview:self.informationListView];
    
    self.backImageView.sd_layout
    .widthRatioToView(self,1)
    .heightRatioToView(self,0.3)
    .topSpaceToView(self,64)
    .leftSpaceToView(self,0);
    
    self.portraitImageView.sd_layout
    .widthIs(100)
    .heightEqualToWidth()
    .leftSpaceToView(self.backImageView,40)
    .topSpaceToView(self.backImageView,40);
    [self.portraitImageView setSd_cornerRadius:@4];
    self.nameLabel.sd_layout
    .widthIs(100)
    .heightRatioToView(self.portraitImageView,0.4)
    .leftSpaceToView(self.portraitImageView,15)
    .topEqualToView(self.portraitImageView);
    
    self.orgLabel.sd_layout
    .widthIs(80)
    .heightRatioToView(self.portraitImageView,0.4)
    .topSpaceToView(self.nameLabel,15)
    .leftEqualToView(self.nameLabel);
    

    self.informationListView.sd_layout
    .bottomSpaceToView(self,30)
    .widthRatioToView(self,1)
    .heightRatioToView(self,0.3);
    
    
    self.enterButton.sd_layout
    .centerYEqualToView(self)
    .widthRatioToView(self,0.8)
    .heightIs(30)
    .centerXEqualToView(self);
    
//    self.callButton.sd_layout
//    .bottomSpaceToView(self.informationListView,100)
//    .centerXEqualToView(self)
//    .widthRatioToView(self,0.8)
//    .heightIs(30);
//    
//    self.enterButton.sd_layout
//    .bottomSpaceToView(self.callButton,10)
//    .widthRatioToView(self.callButton,1)
//    .centerXEqualToView(self)
//    .heightRatioToView(self.callButton,1);
    
    self.userInteractionEnabled = YES;
}

@end
